package com.adam.kafkamq.controller;

import com.adam.kafkamq.producer.OmsProducer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Adam
 * @date 2022/12/9 16:58
 * @desc 测试kafka消息controller
 */
@RestController
@RequestMapping("/kafka")
public class KafkaMessageController {

    @Resource
    private OmsProducer omsProducer;


    @GetMapping("/send/1/{msg}")
    public String sendChannel1(@PathVariable String msg) {
        omsProducer.outputChannel1(msg);
        return msg;
    }

    @GetMapping("/send/2/{msg}")
    public String sendChannel2(@PathVariable String msg) {
        omsProducer.outputChannel1(msg);
        return msg;
    }


}
